package IO.chars;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class TestWriter {
    public static void main(String[] args) {

        try(Writer writer = new FileWriter("d:/test.txt")){
            // 如果想不清空,构造的时候,参数设为 true
//            Writer writer = new FileWriter("d:/test.txt",true);
            writer.write("xdds");

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
